import request from "../utils/request";

/**
 *账户明细列表
 * @param {
 * } params
 * @returns
 */
export function userAssetsPage(params) {
  return request({
    url: "/v1/userAssets/page",
    method: "GET",
    params
  });
}

/**
 * 划转余额信息
 * @param {*} data
 * @returns
 */
export function transferInfo(params) {
  return request({
    url: "/v1/userAssets/transferInfo",
    method: "GET",
    params
  });
}

/**
 * 资金划转
 * @param {*} data
 * @returns
 */
export function userAssetsTransfer(data) {
  return request({
    url: "/v1/userAssets/transfer",
    method: "POST",
    data
  });
}

/**
 *划转记录
 * @param {
 * } params
 * @returns
 */
export function transferRecord(params) {
  return request({
    url: "/v1/userAssets/transferRecord",
    method: "GET",
    params
  });
}
// 资产列表
export function assetsList(){
  
  return request({
    url: "/api/account/total_assets?rate=USD",
    method: "GET"
  });
}
//充值货币
export function charge_currency_list(){
  
  return request({
    url: "/api/account/charge_currency_list",
    method: "GET"
  });
}
//划转货币
export function account_transfer(params){
  
  return request({
    url: "/api/account/transfer",
    method: "POST",
    params
  });
}


// 资产列表2
export function accountList(){
  
  return request({
    url: "/api/account/list",
    method: "GET"
  });
}

/**
 * 我的资产
 * @param {*} data
 * @returns
 */
export function userAssetsInfo(account_type_id=1) {
  return request({
    // url: "/v1/userAssets/userAssetsInfo",
    // url: "/api/account/total_assets?rate=USD",
    url: "/api/account/wallet?account_type_id="+account_type_id+"&rate=USD",
    method: "GET"
  });
}


/**
 *充值记录列表
 * @param {
 * } params
 * @returns
 */
export function userRecordRecharge(params) {
  return request({
    url: "/api/account_log/cashlog",
    method: "GET",
    params
  });
}

/**
 *获取充值地址
 * @param {
 * } params
 * @returns
 */
export function userChainAddressList(id) {
  return request({
    // url: "/v1/userRecordRecharge/userChainAddressList/" + id,
    url: "/api/wallet/wallet?currency_id=" + id,
    method: "GET"
  });
}

/**
 *获取提现信息
 * @param {
 * } params
 * @returns
 */
export function getWithdrawInfo(params) {
  return request({
    // url: `/v1/userRecordWithdraw/getWithdrawInfo/${params.currencyId}`,
    url: `/api/account/detail`,
    method: "GET",
    params
  });
}
//交割历史把
export function microtradeLists(params) {
  return request({
    // url: `/v1/userRecordWithdraw/getWithdrawInfo/${params.currencyId}`,
    url: `/api/microtrade/lists`,
    method: "GET",
    params
  });
}

export function microtrade_submit(params) {
  return request({
    // url: `/v1/userRecordWithdraw/getWithdrawInfo/${params.currencyId}`,
    url: `/api/microtrade/submit`,
    method: "POST",
    params
  });
}

/**
 *提现记录列表
 * @param {
 * } params
 * @returns
 */
export function userRecordWithdraw(params) {
  return request({
    // url: "/v1/userRecordWithdraw/page",
    url: "/api/account_log/outlog",
    method: "GET",
    params
  });
}
/**
 * 用户提现校验
 * @param {*} data
 * @returns
 */
export function userAssetsWithdrawCheck(data) {
  return request({
    url: "/v1/userRecordWithdraw/withdrawCheck",
    method: "POST",
    data
  });
}
/**
 * 用户提现
 * @param {*} data
 * @returns
 */
export function withdraw(data) {
  return request({
    url: "/api/account/draw",
    method: "POST",
    data
  });
}

/**
 *添加提现地址
 * @param {
 * } params
 * @returns
 */
export function addWithdrawAddress(data) {
  return request({
    url: `/v1/userWithdrawAddress/add`,
    method: "POST",
    data
  });
}

/**
 *链路列表
 * @param {
 * }
 * @returns
 */
export function chainList() {
  return request({
    url: `/v1/chain/list`,
    method: "GET"
  });
}

/**
 *用户撤销提现
 * @param {
 * } id
 * @returns
 */
export function revokeWithdraw(id) {
  return request({
    url: `/v1/userRecordWithdraw/revokeWithdraw/` + id,
    method: "GET"
  });
}

/**
 *删除提现地址
 * @param {
 * } params
 * @returns
 */
export function deleteWithdrawAddress(id) {
  return request({
    url: `/v1/userWithdrawAddress/delete/` + id,
    method: "GET"
  });
}

/**
 *提现地址列表
 * @param {
 * } params
 * @returns
 */
export function userWithdrawAddress(params) {
  return request({
    url: `/v1/userWithdrawAddress/list`,
    method: "GET",
    params
  });
}

/**
 * 用户充值记录提交审核
 * @param {*} data
 * @returns
 */
export function RechargeManual(data) {
  return request({
    url: `/v1/userRecordRechargeManual/submit`,
    method: "POST",
    data
  });
}
